package com.px.device.service.impl;

import com.px.common.annotation.DataScope;
import com.px.device.domain.AirportInfo;
import com.px.device.domain.AirportVo;
import com.px.device.mapper.AirportInfoMapper;
import com.px.device.service.IAirportInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 机场信息Service业务层处理
 * 
 * @author WRJ
 * @date 2024-08
 */
@Service
public class AirportInfoServiceImpl implements IAirportInfoService 
{
    @Autowired
    private AirportInfoMapper airportInfoMapper;

    /**
     * 查询机场信息
     *
     * @param airportId 机场信息主键
     * @return 机场信息
     */
    @Override
    public AirportInfo selectAirportInfoByAirportId(Long airportId) {

        return airportInfoMapper.selectAirportInfoByAirportId(airportId);
    }

    /**
     * 查询机场信息列表
     * 
     * @param airportInfo 机场信息
     * @return 机场信息
     */
    @DataScope(deptAlias = "airport_info")
    @Override
    public List<AirportInfo> selectAirportInfoList(AirportInfo airportInfo)
    {
        airportInfo.setDelFlag("0");
        return airportInfoMapper.selectAirportInfoList(airportInfo);
    }

    /**
     * 新增机场信息
     * 
     * @param airportInfo 机场信息
     * @return 结果
     */
    @Override
    public int insertAirportInfo(AirportInfo airportInfo)
    {
        return airportInfoMapper.insertAirportInfo(airportInfo);
    }

    /**
     * 修改机场信息
     * 
     * @param airportInfo 机场信息
     * @return 结果
     */
    @DataScope(deptAlias = "airport_info")
    @Override
    public int updateAirportInfo(AirportInfo airportInfo)
    {
        return airportInfoMapper.updateAirportInfo(airportInfo);
    }

    /**
     * 批量删除机场信息
     * 
     * @param airportIds 需要删除的机场信息主键
     * @return 结果
     */
    @DataScope(deptAlias = "airport_info")
    @Override
    public int deleteAirportInfoByAirportIds(Long[] airportIds)
    {
        return airportInfoMapper.deleteAirportInfoByAirportIds(airportIds);
    }

    /**
     * 删除机场信息信息
     * 
     * @param airportId 机场信息主键
     * @return 结果
     */
    @DataScope(deptAlias = "airport_info")
    @Override
    public int deleteAirportInfoByAirportId(Long airportId)
    {
        return airportInfoMapper.deleteAirportInfoByAirportId(airportId);
    }

    @DataScope(deptAlias = "info")
    @Override
    public List<AirportVo> selectAirportVoList(AirportInfo airportInfo) {
        return airportInfoMapper.selectAirportVoList(airportInfo);
    }

    @DataScope(deptAlias = "airport_info")
    @Override
    public AirportVo selectAirportVoByAirportId(Long airportId) {
        return airportInfoMapper.selectAirportVoByAirportId(airportId);
    }
}
